﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using Himall.Core;

namespace Himall.Entity
{
    public partial class OrderRefundInfo
    {
		
      

        /// <summary>
        /// 退货数量
        /// </summary>
        [NotMapped]
        public long ShowReturnQuantity {
            get
            {
                long result = 0;
                if(this!=null)
                {
                    if(this.ReturnQuantity.HasValue)
                    {
                        result = this.ReturnQuantity.Value;
                    }
                }
                return result;
            }
        }

        /// <summary>
        /// 售后类型
        /// </summary>
        [NotMapped]
        public int RefundType { set; get; }
        /// <summary>
        /// 当前退款状态
        /// </summary>
        [NotMapped]
        public string RefundStatus
        {
            get
            {
                string result = "";
                result = this.SellerAuditStatus.ToDescription();
                if (this.SellerAuditStatus == OrderRefundAuditStatus.Audited)
                {
                    result = this.ManagerConfirmStatus.ToDescription();
                }
                return result;
            }
        }
        /// <summary>
        /// 当前退款状态
        /// </summary>
        [NotMapped]
        public int? RefundStatusValue
        {
            get
            {
                int? result = null;
                result = (int)this.SellerAuditStatus;
                if (this.SellerAuditStatus == OrderRefundAuditStatus.Audited)
                {
                    result = (int)this.ManagerConfirmStatus;
                }
                return result;
            }
        }
        /// <summary>
        /// 可退金额
        /// <para>订单退款为了(实付+运费-优惠)，单件退款(实付-优惠)</para>
        /// </summary>
        [NotMapped]
        public decimal EnabledRefundAmount { get; set; }

        /// <summary>
        /// 订单是否已超过售后期
        /// </summary>
        [NotMapped]
        public bool IsOrderRefundTimeOut { get; set; }

        [NotMapped]
        public object Order { get; set; }

        [NotMapped]
        public string formId { get; set; }
	}
}
